package com.bdqn.t350.ch09;


import com.bdqn.t350.ch09.bean.Right;
import com.bdqn.t350.ch09.bean.User;
import com.bdqn.t350.ch09.mapper.RightMapper;
import com.bdqn.t350.ch09.mapper.UserMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class RightTester {

    @Resource
    RightMapper rightMapper;

    @Resource
    UserMapper userMapper;

    @Test
    public void testSelectList() {
        List<Right> rightList = rightMapper.selectList();
        System.out.println(rightList.size());
    }

    @Test
    public void testByUserNameRightCode() {
        User user = new User();
        user.setUsrName("czkt");
        List<String> list = userMapper.getByUserNameRightCode(user);
        System.out.println(list.size());
    }

}
